Skip to content

Build basic test images with rules_img - #16097

Closed
tamird wants to merge 1 commit into
google:masterfrom
tamird:rules-img-basic-images
Closed

tamird wants to merge 1 commit into
google:masterfrom
tamird:rules-img-basic-images

Conversation

@tamird

@tamird tamird commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Assemble the Alpine, BusyBox and tmpfile test images with Bazel so
remote workers can build and cache them without a Docker daemon. Pin the
AMD64 and ARM64 variants of each base image and declare the tmpfile
fixture as a layer input.

Make computes each image tag from its build context. Stage the Bazel
archive before computing that tag so changes to the assembled image
invalidate the cache. The same rule stages the CUDA images’ shared
context, which contains their compiled helpers. Keep the image names and
registry targets used by tests and CI.

@tamird
tamird force-pushed the rules-img-basic-images branch 2 times, most recently from 1d562c4 to 3987e82 Compare October 22, 2026 14:07
@tamird
tamird force-pushed the rules-img-basic-images branch from 3987e82 to c278666 Compare October 24, 2026 02:26
copybara-service Bot pushed a commit that referenced this pull request Oct 24, 2026
Assemble Alpine, BusyBox and the tmpfile fixture as Bazel image targets
so workers can build and cache them without a Docker daemon. Pin both
architecture variants of the existing base images and declare the
fixture file as a layer input.

Connect the resulting archives to the existing Make image targets. Hash
the assembled archive before looking up cached images so changes to
transitive Bazel inputs invalidate the image tag. Preserve the image
names consumed by tests and the existing registry push/load interface.

Assisted-by: Codex
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#16097 from tamird:rules-img-basic-images c278666
PiperOrigin-RevId: 1006038426
copybara-service Bot pushed a commit that referenced this pull request Oct 24, 2026
Assemble Alpine, BusyBox and the tmpfile fixture as Bazel image targets
so workers can build and cache them without a Docker daemon. Pin both
architecture variants of the existing base images and declare the
fixture file as a layer input.

Connect the resulting archives to the existing Make image targets. Hash
the assembled archive before looking up cached images so changes to
transitive Bazel inputs invalidate the image tag. Preserve the image
names consumed by tests and the existing registry push/load interface.

Assisted-by: Codex
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#16097 from tamird:rules-img-basic-images c278666
PiperOrigin-RevId: 1006038426
Assemble Alpine, BusyBox and the tmpfile fixture as Bazel image targets
so workers can build and cache them without a Docker daemon. Pin both
architecture variants of the existing base images and declare the
fixture file as a layer input.

Stage each image archive before Make looks up its tag, so changes to
transitive inputs invalidate the cache. Use the same staging rule for
the CUDA images, which need the shared helper context. Preserve the
image names and registry targets used by tests and CI.
@tamird
tamird force-pushed the rules-img-basic-images branch from c278666 to 781d64d Compare October 24, 2026 10:44
@tamird

tamird commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

@aaltinaydev, could you re-approve 781d64d? I resolved the Make
conflict with the CUDA image change: Make now stages both the CUDA
helper context and the Bazel-built image archives before computing
their tags. The existing import (#16307) predates that resolution.

Both architecture builds and the three AMD64 container smoke tests
passed: https://app.buildbuddy.io/invocation/c7dad030-2bcb-4d1c-9297-2c2f0770c527

Posted by Codex on behalf of @tamird.

copybara-service Bot pushed a commit that referenced this pull request Oct 24, 2026
Assemble Alpine, BusyBox and the tmpfile fixture as Bazel image targets
so workers can build and cache them without a Docker daemon. Pin both
architecture variants of the existing base images and declare the
fixture file as a layer input.

Connect the resulting archives to the existing Make image targets. Hash
the assembled archive before looking up cached images so changes to
transitive Bazel inputs invalidate the image tag. Preserve the image
names consumed by tests and the existing registry push/load interface.

Assisted-by: Codex
Auto-fixed-by: [🤖] @EtiennePerot
FUTURE_COPYBARA_INTEGRATE_REVIEW=#16097 from tamird:rules-img-basic-images c278666
PiperOrigin-RevId: 1006038426
copybara-service Bot pushed a commit that referenced this pull request Oct 24, 2026
Assemble Alpine, BusyBox and the tmpfile fixture as Bazel image targets
so workers can build and cache them without a Docker daemon. Pin both
architecture variants of the existing base images and declare the
fixture file as a layer input.

Connect the resulting archives to the existing Make image targets. Hash
the assembled archive before looking up cached images so changes to
transitive Bazel inputs invalidate the image tag. Preserve the image
names consumed by tests and the existing registry push/load interface.

Assisted-by: Codex
Auto-fixed-by: [🤖] @EtiennePerot
COPYBARA_INTEGRATE_REVIEW=#16097 from tamird:rules-img-basic-images c278666
PiperOrigin-RevId: 1006446131
@EtiennePerot

Copy link
Copy Markdown
Collaborator

Merged in #16307

tamird added a commit to tamird/gvisor that referenced this pull request Oct 27, 2026
Adding images/basic/BUILD made that directory a separate Bazel package, so
images:sources no longer includes its files through the parent glob. Export
those files explicitly and include them in images:source_contexts, preserving
the Docker contexts that still live under images/basic.

Both BUILD files match the corresponding approved google#16097 postimages. This
restores the source export omitted from its imported change.
copybara-service Bot pushed a commit that referenced this pull request Oct 27, 2026
Adding images/basic/BUILD made that directory a separate Bazel package, so
images:sources no longer includes its files through the parent glob. Export
those files explicitly and include them in images:source_contexts, preserving
the Docker contexts that still live under images/basic.

Both BUILD files match the corresponding approved #16097 postimages. This
restores the source export omitted from its imported change.

FUTURE_COPYBARA_INTEGRATE_REVIEW=#16374 from tamird:restore-basic-image-source-contexts dc6c326
PiperOrigin-RevId: 1007671962
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants